package com.wangijun.yuan.web.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.wangijun.yuan.core.domain.ChatInfo;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

@Mapper
public interface ChatInfoMapper extends BaseMapper<ChatInfo> {
    @Select("select count(*) from chat_info ci where ci.read_flag=0 and ci.send_user_id=#{sendUserId} and ci.receive_user_id=#{receiveUserId} limit 1 ")
    int hasChatInfo(@Param("sendUserId") Long sendUserId, @Param("receiveUserId") Long receiveUserId);
}